package com.aaa.lib_java.annotation;

/**
 * 测试Inherited可继承注解：
 * 子类不显式带注解，但隐式继承了父类的Inherited类型的注解
 */
public class Man extends Person {

    public static void main(String[] args) {
        // region 测试Inherited可继承注解
        Class<Man> subClass = Man.class;
        if (subClass.isAnnotationPresent(MyAnnotation.class)) {
            MyAnnotation annotation = subClass.getAnnotation(MyAnnotation.class);
            String value = annotation.value();
            System.out.println(value);
        }
        // endregion

    }
}
